Enviado por: phpmysql
Fecha: 2003-06-05 10:17:10
Actualizado: 2003-06-19 02:16:12
¿Usa base de datos?: 0
Visitas: 1148
Votos: 0
Descargado: 527 veces
Valoración: 0.00
» Valora este script «
ZipDescargar

Con este script podremos incluir un buen libro de visitas sin mysql en nuestra pagina web. constra de los siguientes archivos: [b]libro.php[/b] que es el archivo done aparece el libro [codigo] <html> <head> <title>libro</title> </head> <body> <div align="center"> <table width="50%" border="1" cellspacing="0"> <tr> <td height="68"><div align="center"><br> <a href="enlaces.php"><img src="libro.gif" alt="" width="48" height="48" border="0"></a> <strong>LIBRO DE VISITAS</strong><br> <br> <font class="content">[ <a href="libro.php">Principal</a> | <a href="escribir.php">Escribir en el libro</a> ]<br> <br> </font></div></td> </tr> </table> <br> <table width="50%" border="1" cellspacing="0"> <tr> <td><div align="center"> <?php include("libro.txt"); #aqu� para cambiar la ruta del archivo que muestra las entradas ?> </div></td> </tr> </table> <br> <br> </div> </body> </html> [/codigo] [b]escribir.php[/b] que es el formulario para que lo rellene la gente [codigo] <html> <head> <title>Untitled Document</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> </head> <body> <div align="center"> <table width="50%" border="1" cellspacing="0"> <tr> <td height="68"><div align="center"><br> <a href="enlaces.php"><img src="libro.gif" alt="" width="48" height="48" border="0"></a> <strong>LIBRO DE VISITAS</strong><br> <br> <font class="content">[ <a href="libro.php">Principal</a> | <a href="escribir.php">Escribir en el libro</a> ]<br> <br> </font></div></td> </tr> </table> <br> <table width="50%" border="1" cellspacing="0"> <tr> <td><div align="center"> <?php print "<table border=0 width=95% cellspacing=1> <form method='post' action='recibir.php' onsubmit='return error ()' name='myform'> <tr> <td width=30%><b>Nombre :</b></b></td> <td width=70%> <input name=nombre maxlenght=30 type=text> </td> </tr> <tr> <td width=30%><b>Email :</b></td> <td width=70%> <INPUT name=email type=text> </td> </tr> <tr> <td width=30%><b>Nombre de tu web :</b></td> <td width=70%> <INPUT name=nombreweb type=text> </td> </tr> <tr> <td width=30%><b>Url :</b></td> <td width=70%> Http:// <INPUT name=weburl type=text> </td> </tr> <tr> <td width=30%><b>Pa�s :</b></td> <td width=70%> <input maxlenght=50 name=pais type=text> </td> </tr> <tr> <td width=30%><b>Ciudad :</b></td> <td width=70%> <input maxlenght=50 name=ciudad type=text> </td> </tr> <tr> <td width=30%><b>Nos encontraste en :</b></td> <td width=70%> <select name=desde> <option value=Buscador>En un buscador</option> <option value=Top>En un top</option> <option value=Directorio>Un enlace de una web</option> <option value=Afiliado>Una web afiliada</option> <option value=...>Otro sitio</option> </select> </td> </tr> <tr> <td width=30%><b>Cual es tu opinion de la web :</b></td> <td width=70%> <input name=grupo type=text id=grupo maxlenght=50> </td> </tr> <tr> <td width=30%><b>Comentarios :</b></td> <td width=70%> <textarea name=comentario rows=5 cols=23></textarea> <input type=submit value=Enviar> </td> </tr> <script> function error (){ if (document.myform.nombre.value == '') { alert('Por favor, introduzca su nombre.'); document.myform.nombre.focus(); return false} if (document.myform.email.value == '') { alert('Por favor, introduzca el email.'); document.myform.email.focus(); return false} if (document.myform.nombreweb.value == '') { alert('Por favor, introduzca el nombre de su web o web preferida.'); document.myform.nombreweb.focus(); return false} if (document.myform.weburl.value == '') { alert('Por favor, introduzca su url, o web preferida.'); document.myform.weburl.focus(); return false} if (document.myform.pais.value == '') { alert('Por favor, introduzca el pais.'); document.myform.pais.focus(); return false} if (document.myform.ciudad.value == '') { alert('Por favor, introduzca la ciudad.'); document.myform.ciudad.focus(); return false} if (document.myform.desde.value == '') { alert('Por favor, introduzca desde donde nos conocio.'); document.myform.desde.focus(); return false} if (document.myform.grupo.value == '') { alert('Por favor, introduce tu opinion de la web.'); document.myform.grupo.focus(); return false} if (document.myform.comentario.value == '') { alert('Por favor, introduzca el comentario.'); document.myform.comentario.focus(); return false} else return getPermission(); } </script> </form> </table> "; ?> </div></td> </tr> </table> <br> <br> </div> </body> </html> [/codigo] [b]recibir.php[/b] es el archivo para procesar el envio de datos del formulario [codigo] <html> <head> <title>Untitled Document</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> </head> <body> <div align="center"> <table width="50%" border="1" cellspacing="0"> <tr> <td height="68"><div align="center"><br> <a href="enlaces.php"><img src="libro.gif" alt="" width="48" height="48" border="0"></a> <strong>LIBRO DE VISITAS</strong><br> <br> <font class="content">[ <a href="libro.php">Principal</a> | <a href="escribir.php">Escribir en el libro</a> ]<br> <br> </font></div></td> </tr> </table> <br> <table width="50%" border="1" cellspacing="0"> <tr> <td><div align="center"> <?php $pvm = getdate(); $archivo="libro.txt"; #aqu� para cambiar la ruta del archivo donde se guardan las entradas $uusi="<table border=0 width=95% cellspacing=1> <tr> <td width=30%><b>Nombre :</b></td> <td width=70%> $nombre </td> </tr> <tr> <td width=30%><b>Fecha : </b></td> <td width=70%>$pvm[mday]-$pvm[mon]-$pvm[year]</td> </tr> <tr> <td width=30%><b>E-mail :</b></td> <td width=70%><a href='mailto:$email'>$email</a></td> </tr> <tr> <td width=30%><b>Web :</b></td> <td width=70%><a href='http://$weburl' target='_blank'>$nombreweb</a></td> </tr> <tr> <td width=30%><b>Localizaci�n :</b></td> <td width=70%>$pais - $ciudad </td> </tr> <tr> <td width=30%><b>Nos encontr� en un:</b></td> <td width=70%> $desde </td> </tr> <tr> <td width=30%><b>Tu opinion de la web :</b></td> <td width=70%> $grupo</td> </tr> <tr> <td width=30%><b>Comentario :</b></td> <td width=70%> $comentario </td> </tr> </table> <hr width=70%>nn"; $fp=fopen($archivo, "r+"); $vanha=fread($fp, filesize($archivo)); fseek($fp, 0); fwrite($fp, "${uusi}${vanha}"); fclose($fp); print "Enlace añadido <a href=enlaces.php>regresar</a>"; ?> </div></td> </tr> </table> </div> <div align="center"></div> </body> </html> [/codigo] Y por ultimo necesitaremos una imagen, que guardaremos junto a los demas fichero (boton derecho raton, guardar imagen como..) [b]libro.gif[/b] [img]http://elcidop.webcindario.com/libro.gif[/img] Sistema de libro_sin_mysql by www.phpmysq.tk and www.elcidop.tk